﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Qu.SeniorProject.Model;

namespace Qu.SeniorProject.WebUI.Utils
{
    public class ControllerHelper
    {
        public static string ValidateStudents(IEnumerable<string> students)
        {
            if (students != null)
            {
                //Validate Students
                if (students.Count() > 3)
                    return "The maximum number of students per project is 3.";

                if (students.Count() > 1 && !ProjectRepository.IsProjectTeamSameGender(students))
                    return "The project team members must be of the same gender.";
            }
            return string.Empty;
        }
    }
}